package cate.game.chat.msg;

import cate.game.chat.OfflinePrivateChatItem;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBChat;
import cate.game.role.Role;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

@ClientMsg(title = "离线期间私聊记录")
public class ChatPrivateHistoryResp implements MsgOutput {
    @NoteField("离线消息数据")
    public List<OfflinePrivateChatItem> history;

    public ChatPrivateHistoryResp() {

    }

    public ChatPrivateHistoryResp(Role role) {
        history = new ArrayList<>(role.getGame().chat.getRoleOfflineHistory(role).values());
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBChat.PRIVATE_HISTORY_RESP;
    }
}
